﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Rabbit.Logic;
using RabbitManage.Code;

namespace RabbitManage.UI
{
    public partial class ShipRuleCityShow : System.Web.UI.Page
    {
        //protected List<Product> list;
        protected Dictionary<string, decimal> dic;

        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies[Constant.CookieName];
            string shopId = cookie.Values[Constant.CookieUid];
            ShipRule rule = RabbitUse.GetShipRuleByShopId(Db.Store, shopId);
            if (rule == null)
            {
                dic = new Dictionary<string, decimal>();
                //foreach (var provinceCity in list)
                //{
                //    dic[provinceCity.Name] = 0m;
                //}
            }
            else
            {
                dic = rule.CityRules;
            }
            myRepeater.DataSource = dic;
            myRepeater.DataBind();

            //HttpCookie cookie = Request.Cookies[Constant.CookieName];
            //string shopId = cookie.Values[Constant.CookieUid];
            //list = RabbitUse.GetProductList(Db.Store, shopId);
            //productRepeater.DataSource = list;
            //productRepeater.DataBind();
        }
    }
}